<div class="menu_top">
    <div id="gaia">
        {% if user %}
        <b>{{ user.email }}</b> |
        {% if user_is_admin %}
        <a href="/tasks/deletedeals">Purge latest deals</a> |
        <a href='/tasks/deletecoupons'>Purge latest coupons</a> |
        {% endif %}
        <a href="{{sign_url}}">Sign out</a>
        {% else %}
        <a href="{{sign_url}}">Sign in with your Google Account</a>
        {% endif %}
    </div>
    <div class="gbh" style="left: 0;right: 0;"> &nbsp;</div>
    <div id="logodiv">
        <div class="yui-gd">
            <div class="yui-u first">
                <div id="title">
                    <a href="/"><img src="/static/images/logo.gif" alt="Deal"></a>
                </div>
            </div>
            <div class="yui-u">
                <div align="right" style="padding-top:10px">
                    <script type="text/javascript">
                        function searchSite() {
                            var q = document.forms[0]["q"].value;
                            window.location.href = "/search/" + q;
                        }
                    </script>
                    <!-- Search Google -->
                    <form method="get" action="http://www.google.com/custom" target="google_window">
                        <label for="sbi" style="display: none">Enter your search terms</label>
                        <input type="text" name="q" size="30" maxlength="255"
                               value="{%if search_term%}{{search_term|unquote}}{%endif%}" id="sbi"></input>
                        <label for="sbb" style="display: none">Submit search form</label>
                        <INPUT type="button" value="Search site" name=projectsearch onclick="searchSite()">
                        <input type="submit" name="sa" value="Google Search" id="sbb"></input>
                        <input type="hidden" name="client" value="pub-1257602387207870"></input>
                        <input type="hidden" name="forid" value="1"></input>
                        <input type="hidden" name="ie" value="UTF-8"></input>
                        <input type="hidden" name="oe" value="UTF-8"></input>
                        <input type="hidden" name="safe" value="active"></input>
                        <input type="hidden" name="cof"
                               value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input>
                        <input type="hidden" name="hl" value="en"></input>
                    </form>
                    <!-- Search Google -->
                </div>
            </div>
        </div>
    </div>
</div>
